#include <iostream>
#include <stdio.h>
#include <string>
#include <stdlib.h>

using namespace std;

int main()
{
	string value = "storage01-1-12312312-4002312323";
	char* p = (char *)value.c_str();
	char* ps[4];
	int j = 0;
	ps[j++] = p;
	while( *p != '\0')
	{
		while( *p != '-' && *p != '\0')
		{
			p++;
		}
		if( *p == '\0') break;
		ps[j++] = p+1;
		*p = '\0';
		p++;
	}
	cout << "name: " << ps[0] << endl;
	cout<< "blockid: " << atoi(ps[1]) << endl;
	cout<< "offset: " <<  atol(ps[2]) << endl;
	cout<< "length: " <<  atol(ps[3]) << endl;
}
